package com.ucode.application.vo.acis;

import com.ucode.acis.mode.Offprint;
import com.ucode.acis.mode.Works;
import com.ucode.oss.model.FileInfo;

public class OffprintVo extends com.ucode.acis.vo.OffprintVo {
    
    private String coverUrl;
    
    private String coverName;

    public OffprintVo(Offprint offprint,Works works,FileInfo coverFile) {
        super();
        if(offprint != null){
            this.setId(offprint.getId());
            this.setCreatedTime(offprint.getCreatedTime());
            this.setUpdatedTime(offprint.getUpdatedTime());
            this.setDeltag(offprint.getDeltag());
            this.setWorksId(offprint.getWorksId());
            this.setName(offprint.getName());
            this.setAuthor(offprint.getAuthor());
            this.setPublisher(offprint.getPublisher());
            this.setPublishTime(offprint.getPublishTime());
            this.setPages(offprint.getPages());
            this.setTranslator(offprint.getTranslator());
            this.setPrice(offprint.getPrice());
            this.setBindingType(offprint.getBindingType());
            this.setGenreType(offprint.getGenreType());
            this.setCoverId(offprint.getCoverId());
            this.setSummary(offprint.getSummary());
            this.setIntro(offprint.getIntro());
            this.setSort(offprint.getSort());
        }
        if(coverFile != null){
            this.setCoverUrl(coverFile.getUrlprefix()+coverFile.getFilePath());
            this.setCoverName(coverFile.getSourceName());
        }
        if(works != null){
            this.setWorksName(works.getName());
        }
    }

    public String getCoverUrl() {
        return coverUrl;
    }

    public void setCoverUrl(String coverUrl) {
        this.coverUrl = coverUrl;
    }

    public String getCoverName() {
        return coverName;
    }

    public void setCoverName(String coverName) {
        this.coverName = coverName;
    }
}
